]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/powerProfiles: Indicate non-default power mode in top bar
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 13 Nov 2025 19:01:04 +0000 (20:01 +0100)
committerMarge Bot <marge-bot@gnome.org>
Tue, 9 Dec 2025 15:10:59 +0000 (15:10 +0000)
It is quite easy to switch the power profile for some specific
purpose, and then forgetting to change it back and experiencing
unexpected performance behavior later.

To help with that, indicate the active power profile in the top
bar if it diverges from the default 'balanced' one.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/7440
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3961>

js/ui/status/powerProfiles.js

index ebaf1f8ea91a442636403e3ef60cda27ce369f89..60ed2fd72f77a3285810730b5afc1f1003821141 100644 (file)
@@ -136,6 +136,17 @@ class Indicator extends SystemIndicator {
     _init() {
         super._init();
 
-        this.quickSettingsItems.push(new PowerProfilesToggle());
+        this._indicator = this._addIndicator();
+
+        this._powerProfilesToggle = new PowerProfilesToggle();
+
+        this._powerProfilesToggle.bind_property('icon-name',
+            this._indicator, 'icon-name',
+            GObject.BindingFlags.SYNC_CREATE);
+        this._powerProfilesToggle.bind_property('checked',
+            this._indicator, 'visible',
+            GObject.BindingFlags.SYNC_CREATE);
+
+        this.quickSettingsItems.push(this._powerProfilesToggle);
     }
 });